Optimal. Leaf size=44 \[ -\frac {a \sin ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {b \cos ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3090, 2633, 2565, 30} \[ -\frac {a \sin ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {b \cos ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2565
Rule 2633
Rule 3090
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x)) \, dx &=\int \left (a \cos ^3(c+d x)+b \cos ^2(c+d x) \sin (c+d x)\right ) \, dx\\ &=a \int \cos ^3(c+d x) \, dx+b \int \cos ^2(c+d x) \sin (c+d x) \, dx\\ &=-\frac {a \operatorname {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}-\frac {b \operatorname {Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {b \cos ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {a \sin ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.01, size = 44, normalized size = 1.00 \[ -\frac {a \sin ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {b \cos ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.75, size = 38, normalized size = 0.86 \[ -\frac {b \cos \left (d x + c\right )^{3} - {\left (a \cos \left (d x + c\right )^{2} + 2 \, a\right )} \sin \left (d x + c\right )}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 3.94, size = 55, normalized size = 1.25 \[ -\frac {b \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac {b \cos \left (d x + c\right )}{4 \, d} + \frac {a \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {3 \, a \sin \left (d x + c\right )}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.03, size = 36, normalized size = 0.82 \[ \frac {\frac {a \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}-\frac {b \left (\cos ^{3}\left (d x +c \right )\right )}{3}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 35, normalized size = 0.80 \[ -\frac {b \cos \left (d x + c\right )^{3} + {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.44, size = 47, normalized size = 1.07 \[ \frac {2\,a\,\sin \left (c+d\,x\right )}{3\,d}-\frac {b\,{\cos \left (c+d\,x\right )}^3}{3\,d}+\frac {a\,{\cos \left (c+d\,x\right )}^2\,\sin \left (c+d\,x\right )}{3\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.43, size = 63, normalized size = 1.43 \[ \begin {cases} \frac {2 a \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {a \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} - \frac {b \cos ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\relax (c )} + b \sin {\relax (c )}\right ) \cos ^{2}{\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________